<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});
$router->get('/sentences', 'SentencesController@latest');
$router->get('/sentences/search', 'SentencesController@search');
$router->get('/sentences/{id}', 'SentencesController@show');
$router->group(['middleware' => 'auth'], function () use ($router) {
    $router->post('/sentences', 'SentencesController@post');
});
$router->get('/users/{id}', 'UsersController@show');
$router->get('/users/{id}/sentences', 'UsersController@sentences');
$router->post('/register', 'UsersController@register');
$router->post('/login', 'UsersController@login');
